﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _1_DBFirst
{
    public partial class BloggingContext: DbContext
    {
        public static string ConnectStr
        {
            get
            {
                var encConnStr = ConfigurationManager.ConnectionStrings["BloggingContext"]?.ToString();
                if (!string.IsNullOrEmpty(encConnStr))
                {
                    AesHelper ah = new AesHelper();
                    return ah.DecryptString(encConnStr);
                }
                return null;
            }
        }

        public BloggingContext(string connStr) : base(connStr)
        {

        }
    }
}
